home *** CD-ROM | disk | FTP | other *** search
/ Wildcat Gold - The Optical BBS / Wildcat Gold - The Optical BBS (The Golden ROM Series)(Volume 4 Number 1)(The Digital Publishing Company)(1992).ISO / sdn / mathpl20.sdn / MATHPLOT.DOC next >
Text File  |  1992-01-05  |  41KB  |  1,008 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                   M A T H P L O T
  10.  
  11.  
  12.  
  13.                       Mathematical Function Plotting Program
  14.  
  15.  
  16.  
  17.                                 Phillip H. Sherrod
  18.  
  19.                               A "shareware" program.
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.               MATHPLOT allows you to specify complicated mathematical
  27.               functions  using  ordinary  algebraic  expressions  and
  28.               immediately plot them.  Four types of functions may  be
  29.               specified:  cartesian  (Y=f(X));  parametric  cartesian
  30.               (Y=f(T)  and  X=f(T));  polar  (Radius=f(Angle));   and
  31.               parametric polar  (Radius=f(T)  and Angle=f(T)).  Up to
  32.               four functions may be plotted simultaneously.   Scaling
  33.               is automatic.    Options  are available to control axis
  34.               display and labeling as well as grid lines.  Hard  copy
  35.               output  may  be  generated  as  well as screen display.
  36.               MATHPLOT is an ideal tool  for  engineers,  scientists,
  37.               math and science teachers, and anyone else who needs to
  38.               quickly visualize mathematical functions.
  39.  
  40.                MATHPLOT -- Mathematical Function Plotter      Page 1
  41.  
  42.  
  43.  
  44.  
  45.          INTRODUCTION
  46.  
  47.          MATHPLOT  is  a  program  for  IBM-PC  computers   which   allows
  48.          interactive entry  and  plotting of mathematical functions.  Some
  49.          of the features of MATHPLOT are listed below:
  50.  
  51.               Direct  entry  of  complicated  mathematical  functions
  52.               using   normal   algebraic  expressions  with  embedded
  53.               operators and functions.
  54.  
  55.               An   assortment   of   built-in   functions   including
  56.               trigonometric,   square  root,  Gamma,  Bessel,  normal
  57.               probability distribution, log, etc.
  58.  
  59.               The ability to plot four types of functions:  cartesian
  60.               (Y=f(X));  parametric  cartesian  (Y=f(T)  and X=f(T));
  61.               polar   (Radius=f(Angle));   and    parametric    polar
  62.               (Radius=f(T) and Angle=f(T)).
  63.  
  64.               The   ability   to   simultaneously  plot  up  to  four
  65.               functions.
  66.  
  67.               Automatic scaling and axis labeling.
  68.  
  69.               The ability to save function specifications in  command
  70.               files which then can be easily executed.
  71.  
  72.               The  ability to accept X-Y data points from an external
  73.               file.
  74.  
  75.               Printed copies of plots may be produced on HP  LaserJet
  76.               printers.
  77.  
  78.                MATHPLOT -- Mathematical Function Plotter      Page 2
  79.  
  80.  
  81.          INSTALLING MATHPLOT
  82.  
  83.          The MATHPLOT system consists of the following files:
  84.  
  85.          MATHPLOT.EXE -- The executable program.
  86.          MATHPLOT.HLP -- Text file accessed by HELP command.
  87.          MATHPLOT.FON -- Font file used for title line and axis labels.
  88.          MATHPLOT.LJF -- Font file for HP LaserJet printer.
  89.          MATHPLOT.FUN -- Example functions
  90.          MATHPLOT.DOC -- Documentation file.
  91.  
  92.          To install MATHPLOT, copy the files into the  directory  of  your
  93.          choice.   If  you do not plan to generated hard copy output for a
  94.          LaserJet printer, you may delete the MATHPLOT.LJF file.   If  the
  95.          MATHPLOT.HLP,  MATHPLOT.FON,  and  MATHPLOT.LJF  files are not in
  96.          your current directory, you must place a command of the following
  97.          form in your AUTOEXEC.BAT file to tell MATHPLOT where to look for
  98.          its help and font files:
  99.  
  100.          SET MATHPLOT=directory
  101.  
  102.          Where "directory" is the name of the device and  directory  where
  103.          the files  are located.  For example, if the files are located in
  104.          a directory named MATHPLOT on the C disk, the  following  command
  105.          could be used:
  106.  
  107.          SET MATHPLOT=C:\MATHPLOT
  108.  
  109.  
  110.  
  111.          GETTING STARTED
  112.  
  113.          MATHPLOT is exceptionally easy to use.  Although there are a fair
  114.          number  of  commands  to control options, you only need to know a
  115.          couple of commands to begin using it.
  116.  
  117.          Start the program by entering the command:
  118.  
  119.          MATHPLOT
  120.  
  121.          MATHPLOT will display a title screen; press Enter to  proceed  to
  122.          command mode.    MATHPLOT  prints  a  greater-than  sign (">") to
  123.          prompt you for a command.  Begin by specifying a simple  function
  124.          to be plotted.  I suggest you enter the command:
  125.  
  126.                MATHPLOT -- Mathematical Function Plotter      Page 3
  127.  
  128.  
  129.          Y=SIN(X)
  130.  
  131.          You may use either upper or lower case letters when  you  type  a
  132.          command.   Next,  command  MATHPLOT to evaluate this function and
  133.          plot the results by entering the command:
  134.  
  135.          PLOT
  136.  
  137.          You should see a sine wave displayed on your screen.  Press Enter
  138.          to return to command mode.  Now let's make the function  slightly
  139.          more complicated by entering the command:
  140.  
  141.          Y=SIN(X)+SIN(3*X)/3
  142.  
  143.          Enter the PLOT command again to see this function plotted.
  144.  
  145.          So  far,  the  function  has  been  evaluated  over  the interval
  146.          (0,2*pi), which is the initial default domain.  Use the following
  147.          command to change the domain to (-2*pi,2*pi):
  148.  
  149.          DOMAIN -2*PI,2*PI
  150.  
  151.          Also, use the following command to turn on grid line display:
  152.  
  153.          GRID ON
  154.  
  155.          Now use the PLOT command to display  the  result.    As  a  final
  156.          exercise,  use  the following command to define a second function
  157.          to be displayed simultaneously with the first one:
  158.  
  159.          Y2=SIN(X)
  160.  
  161.          And, again use the PLOT command to display them.  You should  see
  162.          a simple sine wave (the Y2 function) superimposed on the previous
  163.          function (the Y function).  Use the EXIT command to exit MATHPLOT
  164.          and return to DOS.
  165.  
  166.          Demonstration Command File
  167.  
  168.          The   MATHPLOT   distribution   includes  a  command  file  named
  169.          MATHPLOT.FUN containing a number of  interesting  example  plots.
  170.          You  can  execute  this  command  file by using the MATHPLOT "DO"
  171.          command, or by specifying the  command  file  on  the  invocation
  172.          line.   The following DOS command starts the MATHPLOT program and
  173.          instructs  it  to  execute  the  commands  stored  in  the   file
  174.  
  175.                MATHPLOT -- Mathematical Function Plotter      Page 4
  176.  
  177.  
  178.          MATHPLOT.FUN:
  179.  
  180.          MATHPLOT MATHPLOT.FUN
  181.  
  182.               MATHPLOT -- Mathematical Function Plotter      Page 5
  183.  
  184.  
  185.          FUNCTION SPECIFICATION
  186.  
  187.          Much  of the power of MATHPLOT comes from its ability to evaluate
  188.          complicated functions entered in ordinary algebraic form.    This
  189.          section  explains the arithmetic operators and built in functions
  190.          that are used to define a function.
  191.  
  192.          Arithmetic Operators
  193.  
  194.          The following arithmetic operators may be used in expressions:
  195.  
  196.              +        addition
  197.              -        subtraction or unary minus
  198.              *        multiplication
  199.              /        division
  200.              ** or ^  exponentiation
  201.  
  202.          Exponentiation  has   the   highest   precedence,   followed   by
  203.          multiplication  and  division, and then addition and subtraction.
  204.          Parentheses may be used to group terms.
  205.  
  206.          As a convenience, MATHPLOT allows you to omit the  multiplication
  207.          operator  between  a numeric constant and a following variable or
  208.          function.  For example, the expressions  "2pi",  and  "2 pi"  are
  209.          equivalent to  "2*pi".    Similarly, "5X" is equivalent to "5*X".
  210.          However, if you specify a number before the letter "E",  it  will
  211.          be  taken  as the exponential form of a number (see below) rather
  212.          than  the  number  times  the  constant  E   (base   of   natural
  213.          logarithms).
  214.  
  215.          Numeric Constants
  216.  
  217.          Numeric  constants  may  be  written in their natural form (1, 0,
  218.          1.5, .0003, etc.) or in exponential form, n.nnnEppp, where  n.nnn
  219.          is  the  base value and ppp is the power of ten by which the base
  220.          is multiplied.  For example, the number 1.5E4  is  equivalent  to
  221.          15000.   All  numbers  are  treated  as  "floating point" values,
  222.          regardless of whether a decimal point is specified or not.
  223.  
  224.          Symbolic Constants
  225.  
  226.          There are two numeric  constants  that  may  be  specified  using
  227.          symbolic names.    The  symbolic  name  "PI" is equivalent to the
  228.          value of pi, 3.14159...  Similarly, the symbolic constant "E"  is
  229.          equivalent to the base of natural logarithms, 2.7182818...
  230.  
  231.                MATHPLOT -- Mathematical Function Plotter      Page 6
  232.  
  233.  
  234.  
  235.  
  236.          Parameter values
  237.  
  238.          MATHPLOT allows you to use parameters named P0, P1,  ...,  P9  in
  239.          function definitions.     You  can  then  assign  values  to  the
  240.          parameters and replot the function without having to  retype  the
  241.          function to  change  a  value.  To assign a value to a parameter,
  242.          type the parameter name as a command followed by the value to  be
  243.          assigned.   For  example, the following command assigns the value
  244.          0.67 to the parameter P0:
  245.  
  246.          P0 0.67
  247.  
  248.          Note that parameters are like constants during the evaluation and
  249.          plotting of a function (i.e., their values do not change).    But
  250.          you can assign new values to parameters between plot generations.
  251.          For  example,  consider  the  following  commands  which define a
  252.          function and then plot it twice with two different values of  the
  253.          P0 parameter:
  254.  
  255.          Y = EXP(-P0*X) * COS(X)
  256.          P0  0.6
  257.          PLOT
  258.          P0  0.8
  259.          PLOT
  260.  
  261.          This function represents the response of a damped oscillator with
  262.          the P0  coefficient  controlling the damping factor.  By changing
  263.          the value of the P0 parameter you can examine different forms  of
  264.          the function without having to retype the function.
  265.  
  266.  
  267.          Built in Functions
  268.  
  269.          The  following  functions are built into MATHPLOT and may be used
  270.          in expressions:
  271.  
  272.          ABS(x) -- Absolute value of x.
  273.  
  274.          ACOS(x) -- Arc cosine of x.  Angles are measured in radians.
  275.  
  276.          ASIN(x) -- Arc sine of x.  Angles are measured in radians.
  277.  
  278.               MATHPLOT -- Mathematical Function Plotter      Page 7
  279.  
  280.  
  281.          ATAN(x) -- Arc tangent of x.  Angles are measured in radians.
  282.  
  283.          J0(x) -- Bessel function of the first kind, order zero.
  284.  
  285.          J1(x) -- Bessel function of the first kind, order one.
  286.  
  287.          JN(n,x) -- Bessel function of the first kind, order n.
  288.  
  289.          COS(x) -- Cosine of x.  Angles are measured in radians.
  290.  
  291.          COSH(x) -- Hyperbolic cosine of x.
  292.  
  293.          COT(x) -- Cotangent of x. (COT(x) = 1/TAN(x)).
  294.  
  295.          CSC(X) -- Cosecant of x. (CSC(x) = 1/SIN(x)).
  296.  
  297.          DEG(x)  --  Converts  an  angle,  x,  measured  in radians to the
  298.                    equivalent number of degrees.
  299.  
  300.          EXP(x) -- e (base of natural logarithms) raised to the x power.
  301.  
  302.          FAC(x) -- x factorial (x!).  Note, the FAC function  is  computed
  303.                    using   the   GAMMA   function  (FAC(x)=GAMMA(x+1))  so
  304.                    non-integer argument values may be computed.
  305.  
  306.          GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x! (x factorial).
  307.  
  308.          GAMMAI(x)  --  Reciprocal  of   GAMMA   function   (GAMMAI(x)   =
  309.                    1/GAMMA(x)).
  310.  
  311.          HAV(x) -- Haversine of x. (HAV(x) = (1-COS(x))/2).
  312.  
  313.          LOG(x) -- Natural logarithm of x.
  314.  
  315.          LOG10(x) -- Base 10 logarithm of x.
  316.  
  317.          MAX(x1,x2) -- Maximum value of x1 or x2.
  318.  
  319.          MIN(x1,x2) -- Minimum value of x1 or x2.
  320.  
  321.          NORMAL(x) -- Normal probability distribution of x.  X is in units
  322.                    of standard deviations from the mean.
  323.  
  324.                MATHPLOT -- Mathematical Function Plotter      Page 8
  325.  
  326.  
  327.          PULSE(a,x,b) -- Pulse function.  If the value of x is less than a
  328.                    or greater than b, the value of the function is 0.   If
  329.                    x  is greater than or equal to a and less than or equal
  330.                    to b, the value of the function is 1.  In other  words,
  331.                    it is  1  for  the domain (a,b) and zero elsewhere.  If
  332.                    you need a function that is zero in  the  domain  (a,b)
  333.                    and 1 elsewhere, use the expression (1-PULSE(a,x,b)).
  334.  
  335.          RAD(x) -- Converts an angle measured in degrees to the equivalent
  336.                    number of radians.
  337.  
  338.          SEC(x) -- Secant of x. (SEC(x) = 1/COS(x)).
  339.  
  340.          SIN(x) -- Sine of x.  Angles are measured in radians.
  341.  
  342.          SINH(x) -- Hyperbolic sine of x.
  343.  
  344.          SQRT(x) -- Square root of x.
  345.  
  346.          STEP(a,x) --  Step  function.   If x is less than a, the value of
  347.                    the function is 0.  If x is greater than or equal to a,
  348.                    the value of the function is 1.  If you need a function
  349.                    which is 1 up to a certain value and then 0 beyond that
  350.                    value, use the expression STEP(x,a).
  351.  
  352.          T(n,x) -- Chebyshev polynomial of order n.
  353.  
  354.          TAN(x) -- Tangent of x.  Angles are measured in radians.
  355.  
  356.          TANH(x) -- Hyperbolic tangent of x.
  357.  
  358.          Y0(x) -- Bessel function of the second kind, order zero.
  359.  
  360.          Y1(x) -- Bessel function of the second kind, order one.
  361.  
  362.          YN(n,x) -- Bessel function of the second kind, order n.
  363.  
  364.               MATHPLOT -- Mathematical Function Plotter      Page 9
  365.  
  366.  
  367.          FUNCTION TYPES
  368.  
  369.          MATHPLOT  allows four different types of functions to be plotted:
  370.          cartesian, parametric cartesian,  polar,  and  parametric  polar.
  371.          Each of the function types is described below:
  372.  
  373.          Cartesian Functions
  374.  
  375.          A  cartesian  function  has  the  form  Y=f(X),  where  X  is the
  376.          independent variable that is plotted along  the  horizontal  axis
  377.          and  Y  is  the  dependent variable plotted on the vertical axis.
  378.          The value specified with the DOMAIN command controls the interval
  379.          of X values over which the function is evaluated.  Some  examples
  380.          of this type of function are listed below:
  381.  
  382.          Y=SIN(X)
  383.          Y=2*X**2-3*X+5
  384.          Y=SIN(X)/EXP(X)
  385.          Y=1/SQRT(2*(X+1))
  386.  
  387.          Parametric Cartesian Functions
  388.  
  389.          Parametric  functions use a third variable, which we will call T,
  390.          as the  independent  variable.    Both  X  and  Y  are  dependent
  391.          variables  defined as functions of T. The value of the T variable
  392.          is not directly displayed on the plot but is  used  only  in  the
  393.          functions  that  define  the values of the X and Y variables that
  394.          are plotted.  For example, the following commands define X and  Y
  395.          as functions of T:
  396.  
  397.          X=COS(T)
  398.          Y=SIN(T)
  399.  
  400.          When  parametric  functions  are  defined,  the  DOMAIN statement
  401.          specifies the interval over which the T variable is computed.  If
  402.          the two functions of X and Y specified above are plotted over the
  403.          domain (0,2*PI), the result is a circle with  radius  1  centered
  404.          around the origin.
  405.  
  406.          Polar Functions
  407.  
  408.          A  polar  function  specifies the distance (or radius) of a point
  409.          from the origin as a function  of  the  angle  swept  around  the
  410.          origin.  The angle (A) is the independent variable and the radius
  411.          (R) is  the  dependent  variable.  The DOMAIN statement specifies
  412.  
  413.                MATHPLOT -- Mathematical Function Plotter     Page 10
  414.  
  415.  
  416.          the interval of values that the angle is to  be  evaluated  over.
  417.          The angle begins on the positive  X  axis;  positive  angles  are
  418.          measured counterclockwise around the origin.  Angles are measured
  419.          in  radians;  the  RAD  and  DEG functions can be used to convert
  420.          between degrees and radians.  The simplest polar function is
  421.  
  422.          R=1
  423.  
  424.          which specifies that for all angles the radius is  1.    If  this
  425.          function  is  plotted  over  the  domain (0,2*pi) the result is a
  426.          circle of radius 1 centered around the origin.    Another  simple
  427.          polar function is
  428.  
  429.          R=A
  430.  
  431.          which defines a spiral with the radius increasing with the angle.
  432.  
  433.          Parametric Polar Functions
  434.  
  435.          A  parametric polar function defines the radius (R) and angle (A)
  436.          as functions of the parametric variable, T. The DOMAIN  statement
  437.          defines  the  interval  of  T  values  over which the function is
  438.          evaluated.  The following is an example  of  a  parametric  polar
  439.          function definition:
  440.  
  441.          R=COS(T)
  442.          A=SIN(T)
  443.  
  444.          Over the domain (0,2*pi), this produces a figure-eight pattern.
  445.  
  446.  
  447.          PLOTTING SIMULTANEOUS FUNCTIONS
  448.  
  449.          Up to  four  functions  may  be  plotted  at the same time.  When
  450.          defining multiple functions, add a  single-digit  suffix  to  the
  451.          dependent variable  name  for  the  function.    For example, the
  452.          following  commands  define  four   functions   to   be   plotted
  453.          simultaneously:
  454.  
  455.          Y1=SIN(X)
  456.          Y2=COS(X)
  457.          Y3=SIN(2*X)
  458.          Y4=COS(2*X)
  459.  
  460.               MATHPLOT -- Mathematical Function Plotter     Page 11
  461.  
  462.  
  463.          If no  number  is  specified,  the default value is 1.  Thus, the
  464.          following two function definitions are equivalent:
  465.  
  466.          Y=2*X**2
  467.          Y1=2*X**2
  468.  
  469.          You can remove a function definition by defining another function
  470.          for  the  same  dependent variable or by specifying the dependent
  471.          variable without a function.  For example, the following  command
  472.          removes the definition for Y2:
  473.  
  474.          Y2
  475.  
  476.          When a function of a type (cartesian, polar, etc.) different from
  477.          the  current  type  is  defined,  all  of  the  currently defined
  478.          functions are removed.
  479.  
  480.               MATHPLOT -- Mathematical Function Plotter     Page 12
  481.  
  482.  
  483.          MATHPLOT COMMANDS
  484.  
  485.          The  commands  described  in  this  section  are  used to control
  486.          MATHPLOT. When MATHPLOT is waiting for a command, it  displays  a
  487.          greater-than sign  (">")  as  a  prompt.    If you need to type a
  488.          command that is longer than a single line,  you  may  continue  a
  489.          command  by typing a minus sign as the last character on the line
  490.          to be continued.  When MATHPLOT detects a minus sign as the  last
  491.          character  of  a  line,  it  deletes  the minus sign and requests
  492.          additional command input using the prompt "->".
  493.  
  494.          Commands may be abbreviated to the first three letters  of  their
  495.          keyword.   Commands  may  be  typed  using  upper  or  lower case
  496.          letters.
  497.  
  498.          You may place comments on commands by preceding the comment by an
  499.          exclamation point.  For  example,  the  following  commands  have
  500.          comments:
  501.  
  502.          ! Define square wave function
  503.          Y=SIN(X)+SIN(3*X)/3       ! Approximate square wave
  504.          DOMAIN 0,2*PI              ! One cycle of the function
  505.  
  506.          Startup Command File
  507.  
  508.          The DOS command to start MATHPLOT is:
  509.  
  510.          MATHPLOT [filename]
  511.  
  512.          where  "filename" is an optional parameter specifying the name of
  513.          a file containing commands to be executed by MATHPLOT as soon  as
  514.          it is started.  This startup command file may contain commands to
  515.          set  preferred  default  values,  or  it  may contain one or more
  516.          complete sets of statements to define functions  and  plot  them.
  517.          The default  file extension is ".FUN".  See also the descriptions
  518.          of the DO and SAVE  commands  for  additional  information  about
  519.          command files.
  520.  
  521.          Initialization file
  522.  
  523.          Each  time  Mathplot  is started it attempts to open a file named
  524.          MATHPLOT.INI. If  this  file  exists,  all  commands  in  it  are
  525.          executed.   You  may create such a file to contain initialization
  526.          commands to set default values.  For  example,  if  you  normally
  527.          like   to  have  grid  lines  turned  on,  create  a  file  named
  528.  
  529.                MATHPLOT -- Mathematical Function Plotter     Page 13
  530.  
  531.  
  532.          MATHPLOT.INI containing the command "GRID ON".    Mathplot  looks
  533.          for this file first in the current directory and if it  does  not
  534.          find it there it checks to see if a MATHPLOT environment variable
  535.          has been defined to specify a directory.  The initialization file
  536.          is  executed before any file specified on the command that starts
  537.          Mathplot.
  538.  
  539.          Command Arguments
  540.  
  541.          Many of  the  commands  accept  numeric  arguments.      In   the
  542.          descriptions  below,  the  notation  "cexpr"  is shown wherever a
  543.          numeric argument may be specified.  These numeric  arguments  may
  544.          consist  of  numbers,  symbolic  constants, and expressions using
  545.          operators and built in functions.  For example, the following  is
  546.          a valid DOMAIN command:
  547.  
  548.          DOMAIN -2*PI,PI*SQRT(2)
  549.  
  550.          The  argument expressions may NOT contain variables such as X, Y,
  551.          R, A, or T, or parameters such as P0 or P1.
  552.  
  553.          Arguments shown in brackets are optional.  Braces around a set of
  554.          options indicate that you must choose one of the options  in  the
  555.          set.
  556.  
  557.          ALPHABETICAL LIST OF COMMANDS
  558.  
  559.          AXES {ON | OFF} (default=ON) -- Specifies whether to display axes
  560.                  without labels.    Use the LABELS command to display axes
  561.                  with labels.
  562.  
  563.          CALCULATE cexpr -- Evaluate the specified expression, which  must
  564.                  contain  only numbers, operators, and built in functions,
  565.                  and print the result.
  566.  
  567.          CAXES cexpr (default=3) -- Specify the color to be used  for  the
  568.                  axis lines and labels.
  569.  
  570.          CFn cexpr  (default=2,1,4,3)  -- Define the color to be used when
  571.                  plotting function 'n'.  For example, the command  "CF1 3"
  572.                  specifies  that  color  3  is  to  be  used when plotting
  573.                  function 1.
  574.  
  575.                MATHPLOT -- Mathematical Function Plotter     Page 14
  576.  
  577.  
  578.          CGRID cexpr (default=8) -- Specify the color to be used for  grid
  579.                  lines.
  580.  
  581.          CLEAR -- Clear the screen.
  582.  
  583.          COMMONSCALE {ON | OFF} (default=OFF) -- If this option is  turned
  584.                  on,  the  X  and Y directions are forced to have the same
  585.                  scale.  If this option is off, the X  and  Y  ranges  are
  586.                  scaled  independently,  which  may  cause  figures  to be
  587.                  distorted - for example,  a  circle  may  display  as  an
  588.                  ellipse.   However,  turning this option on may result in
  589.                  one of the dimensions using only a small portion  of  the
  590.                  screen if  the  X  and Y ranges are very different.  This
  591.                  option is always on for polar function plots.
  592.  
  593.          CTITLE cexpr (default=7) -- Specify the  color  to  use  for  the
  594.                  title line.
  595.  
  596.          DATA filename  --  Causes  X and Y data values to be read from an
  597.                  external file rather  than  being  computed  as  function
  598.                  definitions.   After the data has been read, use the PLOT
  599.                  command to display it.  Any function definition following
  600.                  this command will clear  the  external  data  values  and
  601.                  revert to  function  mode.    Each  X,Y data pair must be
  602.                  specified as a separate line in the  file  with  a  space
  603.                  separating the  X  value  from  the Y value.  The default
  604.                  extension for the file is ".DAT".
  605.  
  606.          DISPLAY string -- Display  the  string  on  the  console.    This
  607.                  command   may   be   placed  in  command  file  to  cause
  608.                  information to be printed while the command file is being
  609.                  processed.
  610.  
  611.          DO filename  --  Execute  the  MATHPLOT  commands  stored  in  an
  612.                  external file.    This  allows  you to specify a complete
  613.                  plot request, including functions and options,  and  then
  614.                  execute it  without  having  to  retype the commands.  An
  615.                  external file may itself contain a DO  command  and  this
  616.                  nesting may  be  performed  to  a depth of 10 files.  The
  617.                  default file  extension  is  ".FUN".     See   also   the
  618.                  description of the SAVE command.
  619.  
  620.                MATHPLOT -- Mathematical Function Plotter     Page 15
  621.  
  622.  
  623.          DOMAIN cexpr1,cexpr2 (default=0,2*pi) -- Define the domain of the
  624.                  independent  variable  over  which  the   functions   are
  625.                  evaluated and  plotted.    The  lower  end  of the domain
  626.                  (cexpr1) must be less than the upper end (cexpr2).   This
  627.                  command may be abbreviated to "DOM".
  628.  
  629.          EXIT -- Stop MATHPLOT and return to DOS.
  630.  
  631.          GRID {ON | OFF}  (default=OFF)  -- Specify whether grid lines are
  632.                  to be displayed.
  633.  
  634.          HELP -- Display several pages of help text.
  635.  
  636.          LABEL {ON | OFF} (default=ON) -- Specify whether axes with labels
  637.                  are to be displayed.
  638.  
  639.          LIST {ON | OFF}  (default=OFF)  --   Specify   whether   commands
  640.                  executed  from  an external file by use of the DO command
  641.                  are to be listed as they are executed.
  642.  
  643.          NUMPOINTS cexpr (default=100) -- Specify the number of points  at
  644.                  which  the functions are to be evaluated over the domain.
  645.                  Specifying  a  larger  number  of  points  results  in  a
  646.                  smoother plot  but  increases  the computation time.  The
  647.                  maximum number of points that may be  computed  is  2000.
  648.                  This command may be abbreviated to the single letter 'N'.
  649.  
  650.          ORIGIN {ON | OFF}  (default=OFF)  --  Specify  whether the origin
  651.                  (0,0) is to be forced to be included in  the  plot.    If
  652.                  this  option is off and the range of values does not span
  653.                  0, then the origin may not be displayed.    Turning  this
  654.                  option  on  allows  the range of the function relative to
  655.                  the origin to be observed, but  may  result  in  a  small
  656.                  scale factor if the range is far from the origin.
  657.  
  658.          Pn cexpr  -- Specify a value for parameter Pn where 'n' is in the
  659.                  range 0 to 9.  MATHPLOT allows  you  to  use  up  to  ten
  660.                  parameter values   in   function   specifications.    The
  661.                  parameters are named P0, P1, ..., P9.  You can  assign  a
  662.                  new  value to a parameter and replot the function without
  663.                  having to retype the function.
  664.  
  665.                MATHPLOT -- Mathematical Function Plotter     Page 16
  666.  
  667.  
  668.          PAUSE [cexpr] (default=0) -- This command  may  be  placed  in  a
  669.                  command file to cause execution to pause until a  key  is
  670.                  pressed or  the  specified  number of seconds elapse.  If
  671.                  cexpr is omitted or has the value 0, execution pauses for
  672.                  an indefinite time until a key is pressed.
  673.  
  674.          PDEVICE device (default=PRN) -- Allows you to specify the  device
  675.                  or  file to which printer output is written when printing
  676.                  is turned on by use of the PRINT ON command.  The default
  677.                  device is "PRN" but you may specify another  device  such
  678.                  as LPT2 or COM. You may also direct output to a disk file
  679.                  that  you  can  printer later using the DOS PRINT or COPY
  680.                  commands.
  681.  
  682.          PLOT [cexpr]  (default=0)  --  Evaluate  the  currently   defined
  683.                  functions and plot them.  If an optional value (cexpr) is
  684.                  specified,  the  function  is displayed for the specified
  685.                  number of seconds or until a key  is  pressed.    If  the
  686.                  optional  value  is  omitted  or  is  zero,  the  plot is
  687.                  displayed for an indefinite time until a key is  pressed.
  688.                  The  use  of  the  optional value is most useful when the
  689.                  PLOT command occurs in a command file producing a  "slide
  690.                  show" of  functions.   This command may be abbreviated to
  691.                  the letter 'P'.
  692.  
  693.          PRINT {ON | OFF} (default=OFF) -- Turns printer output on or off.
  694.                  When turned on, any plot displayed on the screen is  also
  695.                  written  to  the  printer  (or  file  as  directed by the
  696.                  PDEVICE command).
  697.  
  698.          RESET -- Reset all parameters and options to their initial values
  699.                  and remove all function definitions.
  700.  
  701.          SAVE filename -- Write the current function definitions  and  the
  702.                  values  of  all  options  and parameters to the specified
  703.                  file.  The DO command can then be used at a later time to
  704.                  redisplay the function.  The default  file  extension  is
  705.                  ".FUN".
  706.  
  707.          TABULATE  --  Evaluate  the  functions  and  print  the values in
  708.                  tabular form rather than plotting them.
  709.  
  710.               MATHPLOT -- Mathematical Function Plotter     Page 17
  711.  
  712.  
  713.          TITLE string -- Define a title line to be displayed at the top of
  714.                  the plot.
  715.  
  716.          WAXES cexpr  (default=3)  --  Specify  the width (in dots) of the
  717.                  axis lines for printed output.  This parameter  does  not
  718.                  affect the screen display.
  719.  
  720.          WFn cexpr  (default=3) -- Specify the width (in dots) of the line
  721.                  used to draw the plot of function 'n'.  This only affects
  722.                  hard copy output.
  723.  
  724.          WGRID cexpr (default=1) -- Specify the width  (in  dots)  of  the
  725.                  grid lines.  This only affects hard copy output.
  726.  
  727.                MATHPLOT -- Mathematical Function Plotter     Page 18
  728.  
  729.  
  730.          ADVANCED APPLICATIONS
  731.  
  732.          Root Finding
  733.  
  734.          MATHPLOT can be used to find the roots of equations.  To do this,
  735.          turn on axis labeling (LABEL ON) and plot the function  over  the
  736.          domain in  which  a root occurs.  Observe the approximate X value
  737.          at which the function crosses the  X  axis  and  then  reset  the
  738.          domain to  closely  span the crossing point.  Replot the function
  739.          and obtain a new X estimate.  After several iterations  you  will
  740.          be able to determine the root to several significant digits.  For
  741.          example, use this technique to find the root of the function:
  742.  
  743.          Y = X^4 - EXP(X)
  744.  
  745.          in the domain (2,9.5).
  746.  
  747.          For  a  course  in Algebra I, MATHPLOT can be used to demonstrate
  748.          the graphical method of solving two simultaneous linear equations
  749.          by locating the point of intersection.  For an Algebra II course,
  750.          MATHPLOT can be used to locate minimum  and  maximum  points  for
  751.          quadratic and cubic equations.
  752.  
  753.          Multiple Domains
  754.  
  755.          MATHPLOT  only allows specification of a single continuous domain
  756.          of values.  However, by  using  the  multiple  function  plotting
  757.          capability it is sometimes possible to simulate multiple domains.
  758.          For example, the function X*Y=5 defines a hyperbola with branches
  759.          in  both  the  positive X-Y domain (upper right quadrant) and the
  760.          negative X-Y domain (lower left quadrant).  The following set  of
  761.          commands  defines  two  parametric  functions to draw each of the
  762.          branches:
  763.  
  764.          X1=T
  765.          Y1=5/T
  766.          X2=-T
  767.          Y2=-5/T
  768.          DOMAIN 0.5,10
  769.          LABEL ON
  770.          COMMONSCALE ON
  771.          PLOT
  772.  
  773.               MATHPLOT -- Mathematical Function Plotter     Page 19
  774.  
  775.  
  776.          Interesting Functions
  777.  
  778.          The  following  specifications  plot  interesting  and attractive
  779.          functions:
  780.  
  781.          TITLE Four Leaved Rose
  782.          CTITLE 4
  783.          R=2*SIN(2*A)
  784.          CF1 3
  785.          DOMAIN 0,2*PI
  786.          NUMPOINTS 150
  787.          AXES ON
  788.          CAXES 1
  789.          PLOT
  790.  
  791.          TITLE Prolate Cycloid
  792.          CTITLE 4
  793.          Y=1-2*COS(T)
  794.          X=T-2*SIN(T)
  795.          CF1 2
  796.          DOMAIN -4*PI,4*PI
  797.          NUMPOINTS 400
  798.          CAXES 1
  799.          COMMONSCALE ON
  800.          PLOT
  801.  
  802.          TITLE Hypocycloid of four cusps (Asteroid)
  803.          CTITLE 4
  804.          Y=SIN(T)^3
  805.          X=COS(T)^3
  806.          CF1 2
  807.          DOMAIN 0,2*PI
  808.          NUMPOINTS 100
  809.          AXES ON
  810.          CAXES 1
  811.          COMMONSCALE ON
  812.          PLOT
  813.  
  814.               MATHPLOT -- Mathematical Function Plotter     Page 20
  815.  
  816.  
  817.          TITLE Bifolium
  818.          CTITLE 4
  819.          Y=2*SIN(T)^2*COS(T)^2
  820.          X=2*SIN(T)*COS(T)^3
  821.          CF1 3
  822.          DOMAIN 0,2*PI
  823.          NUMPOINTS 100
  824.          AXES ON
  825.          CAXES 1
  826.          COMMONSCALE ON
  827.          PLOT
  828.  
  829.          TITLE Epicycloid
  830.          CTITLE 4
  831.          Y=5*SIN(T)-SIN(5*T)
  832.          X=5*COS(T)-COS(5*T)
  833.          CF1 3
  834.          DOMAIN 0,2*PI
  835.          NUMPOINTS 150
  836.          AXES ON
  837.          CAXES 1
  838.          COMMONSCALE ON
  839.          PLOT
  840.  
  841.          "Artistic" Plots
  842.  
  843.          When  MATHPLOT plots a function, it evaluates the function at the
  844.          number of points specified by the last NUMPOINTS command and then
  845.          connects the points together using straight lines.  By specifying
  846.          very large domain values for polar or parametric  functions,  the
  847.          lines  connecting  the  points  span  large distances and produce
  848.          interesting and "artistic" plots.  It is best to  turn  off  axis
  849.          display   (AXES OFF,  LABELS OFF)  and  turn  on  common  scaling
  850.          (COMMONSCALE ON) for these plots.  Here are some examples to try:
  851.  
  852.          Y=SIN(T)^3
  853.          X=COS(T)^3
  854.          CF1 2
  855.          DOMAIN 0,4000
  856.          NUMPOINTS 500
  857.  
  858.               MATHPLOT -- Mathematical Function Plotter     Page 21
  859.  
  860.  
  861.          R=2*SIN(2*A)
  862.          CF1 3
  863.          DOMAIN 0,2000
  864.          NUMPOINTS 500
  865.  
  866.          Y=5*SIN(T)-SIN(5*T)
  867.          X=5*COS(T)-COS(5*T)
  868.          CF1 3
  869.          DOMAIN 0,6000
  870.          NUMPOINTS 400
  871.  
  872.          Parametric  and polar functions seem to produce the best artistic
  873.          plots.  By varying  the  NUMPOINTS  and  DOMAIN  values  you  can
  874.          usually produce many different plots from the same functions.
  875.  
  876.                MATHPLOT -- Mathematical Function Plotter     Page 22
  877.  
  878.  
  879.          USE AND DISTRIBUTION OF MATHPLOT
  880.  
  881.          MATHPLOT is a "shareware" product.    You  are  welcome  to  make
  882.          copies  of  this program and pass them on to friends or post this
  883.          program on bulletin boards.
  884.  
  885.          However, if you find MATHPLOT to be  useful  and/or  entertaining
  886.          you  are  expected  to  send  to the author the registration form
  887.          printed on the next page with $20 to help cover  the  development
  888.          and  support  of  MATHPLOT.  In return, you will receive the most
  889.          recent version of the program and a bound  copy  of  the  manual.
  890.          Add $5 if Mathplot is being shipped out of the United States.
  891.  
  892.          See also the special offer with Nonlin that follows.
  893.  
  894.          You are welcome to write to the author at:
  895.  
  896.                              Phillip H. Sherrod
  897.                              4410 Gerald Place
  898.                              Nashville, TN  37205-3806
  899.  
  900.          Both  the  MATHPLOT  program  and documentation are copyright (c)
  901.          1991-1992 by Phillip H. Sherrod.    You  are  not  authorized  to
  902.          modify the program. "MATHPLOT" is a trademark.
  903.  
  904.          Disclaimer
  905.  
  906.          MATHPLOT is provided "as is" without warranty of any kind, either
  907.          expressed or  implied.    This  program  may  contain  "bugs" and
  908.          inaccuracies, and its results should not be assumed to be correct
  909.          unless they are  verified  by  independent  means.    The  author
  910.          assumes no responsibility for the use of MATHPLOT and will not be
  911.          responsible for any damage resulting from its use.
  912.  
  913.                MATHPLOT -- Mathematical Function Plotter     Page 23
  914.  
  915.  
  916.                                     N O N L I N
  917.  
  918.               Nonlinear Regression Analysis Program -- Special Offer
  919.  
  920.          If you  like  Mathplot,  you  should  check  out  Nonlin  --  the
  921.          nonlinear regression  analysis  program by the same author.  And,
  922.          if you register your use of Mathplot and order Nonlin at the same
  923.          time, you can get both for the special price of $36.
  924.  
  925.          What is  regression  analysis?     Regression   analysis   is   a
  926.          mathematical   technique  for  determining  the  best  values  of
  927.          parameters to fit an equation to a  set  of  data  points.    For
  928.          example, you might want to develop an equation of the form
  929.  
  930.          price = p0 + p1*age + p2*miles
  931.  
  932.          to  predict  the  price  of  a  used car based on its age and the
  933.          number of miles driven.  With Nonlin you can  collect  data  from
  934.          car  ads and then perform the analysis using the following set of
  935.          commands:
  936.  
  937.              VARIABLES PRICE,AGE,MILES
  938.              PARAMETERS P0,P1,P2
  939.              FUNCTION  PRICE = P0 + P1*AGE + P2*MILES
  940.              DATA
  941.  
  942.          Nonlin will analyze the data and determine the best values of the
  943.          parameters P0, P1, and P2 to fit the data values.
  944.  
  945.          Ordinary linear regression programs can only determine  parameter
  946.          values for  linear  (straight  line)  equations.   Nonlin, on the
  947.          other hand, can  handle  multivariate,  linear,  polynomial,  and
  948.          general nonlinear  equations.   For example, using Nonlin you can
  949.          easily determine the  best  values  for  the  parameters  Offset,
  950.          Amplitude, and Frequency for an equation of the form:
  951.  
  952.          Y = Offset + Amplitude * sin(Frequency * X)
  953.  
  954.          Nonlin  uses the same expression evaluator as Mathplot so you can
  955.          model complicated equations using the full set of  operators  and
  956.          library functions available in Mathplot.
  957.  
  958.          If  you  do  any data analysis, or would just like to learn about
  959.          the incredibly useful regression  analysis  technique,  you  need
  960.          Nonlin!
  961.  
  962.                MATHPLOT -- Mathematical Function Plotter     Page 24
  963.  
  964.  
  965.        =====================================================================
  966.                                 Software Order Form
  967.        =====================================================================
  968.  
  969.          NAME ______________________________________________________
  970.  
  971.          ADDRESS ___________________________________________________
  972.  
  973.          CITY _______________________  STATE _______ ZIP ___________
  974.  
  975.          TELEPHONE _________________________________________________
  976.  
  977.          COMPUSERVE ACCOUNT (optional) _____________________________
  978.  
  979.          MATHPLOT VERSION (on title screen) ________________________
  980.  
  981.          BULLETIN BOARD WHERE YOU FOUND MATHPLOT ___________________
  982.  
  983.          COMMENTS __________________________________________________
  984.  
  985.  
  986.          Check the box below which indicates your order type:
  987.  
  988.          ___ I wish to register Mathplot ($20).
  989.  
  990.          ___ I wish to order Nonlin ($20).
  991.  
  992.          ___ I wish to register Mathplot and order Nonlin ($36).
  993.  
  994.          Add $5 to any amount shown above if the software is being shipped
  995.          out of the United States.
  996.  
  997.          Distribution disk choice (check one):
  998.  
  999.                3.50" HD (1.4 MB)  ______
  1000.                5.25" HD (1.2 MB)  ______
  1001.                5.25" DD (360 KB)  ______
  1002.  
  1003.          Send this form with the amount indicated to the author at:
  1004.  
  1005.                                 Phillip H. Sherrod
  1006.                                  4410 Gerald Place
  1007.                              Nashville, TN  37205-3806
  1008.